package com.example.cashier.adapter

import android.widget.CheckBox
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.cashier.R
import com.example.cashier.entity.CashierEntityItem
import com.example.cashier.entity.CashierRvEntity
import com.example.cashier.entity.OnAllCheckChangeListener
import com.example.cashier.entity.OnItemCheckBoxClickListener

class CashierXiangAdapter :BaseQuickAdapter<CashierEntityItem,BaseViewHolder>(R.layout.item_cashier_xiang) {
    override fun convert(holder: BaseViewHolder, item: CashierEntityItem) {
        holder.setText(R.id.tv_time, item.paymentTime)
        holder.setText(R.id.tv_num, "共1项")
        holder.setText(R.id.tv_allPrince, "合计:¥" + item.chargeAmount)
        holder.setText(R.id.paydetail_type,item.chargeType)
        holder.setText(R.id.paydetail_time,item.paymentTime)
        holder.setText(R.id.paydetail_money,"¥"+item.chargeAmount)
        val checkBox = holder.getView<CheckBox>(R.id.paydetail_cb)
        checkBox.isChecked=item.idChecked
//        holder.setText(R.id.tv_time, item.time)
//        holder.setText(R.id.tv_num, "共" + item.num + "项")
//        holder.setText(R.id.tv_allPrince, "合计:¥" + item.price)
//        val recyclerView = holder.getView<RecyclerView>(R.id.rv)
//        var cashierXiangAdapter2 = CashierXiangAdapter2()
//        recyclerView.layoutManager = LinearLayoutManager(context)
//        recyclerView.adapter = cashierXiangAdapter2
//        cashierXiangAdapter2.data.clear()
//        cashierXiangAdapter2.addData(item.list.filter { it.paymentStatus == "未缴费" })
    }
}
